<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="ch-ZN">
<head>
		<meta charset="UTF-8">
    <title>${fns:getConfig('productName')}<spring:message code="login"/></title>		
		<%-- <%@ include file="/WEB-INF/views/include/head.jsp"%> --%>
		<link href="${ctxStatic}/jquery-validation/1.14.0/css/screen.css" rel="stylesheet" />
		<link rel="stylesheet" href="${ctxStatic}/css/login.css">
    <script src="${ctxStatic}/jquery/jquery-1.9.1.js" type="text/javascript"></script>
    <script src="${ctxStatic}/jquery-validation/1.14.0/jquery.validate.js" type="text/javascript"></script>		
		<script type="text/javascript">
		  //IE
      var shell = new ActiveXObject("WScript.Shell");
      shell.SendKeys("{F11}");
    </script>
    <script type="text/javascript">
        $(document).ready(function() {
            $("#loginForm").validate({
                rules: {
                   /*  validateCode: {remote: "${pageContext.request.contextPath}/servlet/validateCodeServlet"} */
                },
                messages: {
                    username: {required: "<spring:message code='login_save_userName'/>"},password: {required: "<spring:message code='login_save_password'/>"},
                    validateCode: {remote: "<spring:message code='login_save_validateCode_message'/>", required: "<spring:message code='login_save_validateCode'/>"}
                },
               errorLabelContainer: "#messageBox",
               errorPlacement: function(error, element) {
                    error.appendTo($("#loginError"));
               }    
            });
        });
        // 如果在框架或在对话框中，则弹出提示并跳转到首页
        if(self.frameElement && self.frameElement.tagName == "IFRAME"){
            alert("<spring:message code='login_timeout'/>");
            top.location = "${ctx}";
        }
        function loginForgetPassword(){
        	 window.location.href = "${ctx}/sysLoginForgetPassword";
        	 //window.open('上传文件', '600px', '450px', "${ctx}/sysLoginForgetPassword");
        }
    </script>
</head>
<body>

<div class="loginBox">
    <div class="loginTit clearfix">
        <img src="${ctxStatic}/images/login_icon_01.png">
        <p><spring:message code="login"/></p>
    </div>
    <!--<div class="black">&nbsp;</div>-->
    <div class="verifyTxt" id="messageBox"  style="${empty message ? 'display: none' : ''} ">
       <label id="loginError" class="error" >${message}</label>
    </div>
    <%-- 
    <div id="messageBox" class="alert alert-error ${empty message ? 'hide' : ''}"><button data-dismiss="alert" class="close">×</button>
            <label id="loginError" class="error">${message}</label>
        </div> --%>
        <form id="loginForm"  action="${ctx}/login" method="post">
    <div class="inputBox">
            <div class="inpBoxSm">
                <input type="text" id="username" name="username"  class="required" value="${username}" placeholder="<spring:message code='login_save_userName'/>">
                <img src="${ctxStatic}/images/login_icon_02.png">
            </div>
            <div class="inpBoxSm">
                <input type="password" id="password" name="password"  class="required" placeholder="<spring:message code="login_save_password"/>">
                <img src="${ctxStatic}/images/login_icon_03.png">
            </div>
            <%-- <div class="clearfix">
                <sys:validateCode name="validateCode" inputCssStyle="margin-bottom:0;"/>
            </div> --%>
    </div>
    
    <div class="textC" style="position:relative">
        <!-- 忘记密码 -->
        <p class="forget" onclick="window.location.href = '${ctx}/forgetPassword/sysLoginForgetPassword'">
            <spring:message code="forgetPassword_forgetPassword"/>
        </p>
        <button class="loginBtn"><spring:message code="login"/></button>
       
    </div>
    </form>
</div>

<script>
	var windowH = window.innerHeight
	||document.documentElement.clientHeight
	||document.body.clientHeight
	$('.loginBox').css('margin-top',windowH/2 - 207);

    window.onresize = function(){
    var windowH = window.innerHeight
            ||document.documentElement.clientHeight
            ||document.body.clientHeight
    $('.loginBox').css('margin-top',windowH/2 - 207);
    }
</script>

</body>
</html>